package com.xiang.springboot.demo.mongodb.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by admin on 2019/3/18.
 */
@Document(collection = "t2")
@Data
public class Entity2 implements Serializable {
    @Id
    private String id;
    private String name;
    private int age;
    private Date crtm;

    public Entity2(String name, int age) {
        this.name = name;
        this.age = age;
        this.crtm = new Date();
    }
}
